'''
Created on Jun 6, 2015

@author: geo
'''

from django.db import models 

class Album(models.Model):
    name = models.CharField(max_length = 200) 
    link = models.URLField()
    artist = models.ForeignKey('Artist')
    #price = models.DecimalField(max_digits = 10, decimal_places = 2) # bad for $9.99
    price = models.CharField(max_length = 30) # bad for $9.99
    genre = models.CharField(max_length = 50)
    cover_art = models.URLField()
    release_date = models.CharField(max_length = 30) # 'June 5, 2015' is not  a legal date format. just use charfield for now
    #date = models.DateField() # To Do: convert format of 'June 5, 2015' to legal date format, and then use CharField
    
    def __unicode__(self):
        """
        just return the name of album
        """
        return self.name


class Artist(models.Model):
    name = models.CharField(max_length = 200, unique = True)
    link = models.URLField()
    
    def __unicode__(self):
        """
        just return the name of album
        """
        return self.name
    
    
    